package com.sgj.pojo;

import lombok.*;

import java.util.Objects;

/**
 * @author 沈国纪
 * @date 2021/2/19 9:45
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Employee {

    /**
     * 姓名
     */
    private String name;

    /**
     * 年龄
     */
    private Integer age;

    /**
     * 薪资
     */
    private Double salary;

    private com.sgj.enums.Status Status;

    public Employee(Integer age) {
        this.age = age;
    }

    public Employee(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {return true;}
        if (o == null || getClass() != o.getClass()) {return false;}
        Employee employee = (Employee) o;
        return age.equals(employee.age) &&
                Objects.equals(name, employee.name) &&
                Objects.equals(salary, employee.salary);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, salary);
    }

}
